package cn.com.generaldata.os.importpojo;

import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlTransient;

import com.sun.xml.internal.bind.CycleRecoverable;

public class Area implements java.io.Serializable, CycleRecoverable {

	private static final long serialVersionUID = -6404314064704214469L;

	private String id; // 行政区划Id
	private String areaName; // 行政区划中文名称
	private String areaDesc; // 行政区划拼音描述
	private String areaCode; // 行政区划代码
	private String areaZimuCode; // 行政区划拼音字头
	private String parentId; // 上级ID
	private Set<User> users = new HashSet<User>(0);
	private Set<Report> reports = new HashSet<Report>(0);
	private Set<Unit> units = new HashSet<Unit>(0);
	private Set<Unit> registUnits = new HashSet<Unit>(0);

	public Set<Unit> getRegistUnits() {
		return registUnits;
	}

	public void setRegistUnits(Set<Unit> registUnits) {
		this.registUnits = registUnits;
	}

	public Area() {
	}

	public Area(String id, String areaName, String areaCode) {
		this.id = id;
		this.areaName = areaName;
		this.areaCode = areaCode;
	}

	public Set<Unit> getUnits() {
		return units;
	}

	public void setUnits(Set<Unit> units) {
		this.units = units;
	}

	public Area(String id, String areaName, String areaDesc, String areaCode, String areaZimuCode, String parentId,
			Set<User> users, Set<Report> reports, Set<Unit> units, Set<Unit> registUnits) {
		super();
		this.id = id;
		this.areaName = areaName;
		this.areaDesc = areaDesc;
		this.areaCode = areaCode;
		this.areaZimuCode = areaZimuCode;
		this.parentId = parentId;
		this.users = users;
		this.reports = reports;
		this.units = units;
		this.registUnits = registUnits;
	}

	/**
	 * 解决CXF循环引用问题.
	 * 
	 * @param arg0
	 * @return
	 */
	@Override
	public Object onCycleDetected(Context arg0) {
		Area temp = new Area();
		temp.setId(id);
		return temp;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	public String getAreaDesc() {
		return areaDesc;
	}

	public void setAreaDesc(String areaDesc) {
		this.areaDesc = areaDesc;
	}

	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	public String getAreaZimuCode() {
		return areaZimuCode;
	}

	public void setAreaZimuCode(String areaZimuCode) {
		this.areaZimuCode = areaZimuCode;
	}

	@XmlTransient
	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

	@XmlTransient
	public Set<Report> getReports() {
		return reports;
	}

	public void setReports(Set<Report> reports) {
		this.reports = reports;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

}
